<template>
  <div class="dashboard-container">
   <p><b>钟嘉荣 1903010347</b></p>
   
    
   
   <br><div style="color:red">学校数量：{{schoolnum}}</div>
   
   <br><div>学院数量：{{academynum}}</div>
   <br><div>班级数量：{{classsnum}}</div>
   <br><div>学生数量：{{studentnum}}</div>
   <br><div>教师数量：{{teachernum}}</div>

  
  </div>

</template>
<script>
  import { mapGetters } from 'vuex'

  export default {
    name: 'Dashboard',
    data () {
      return {
        schoolnum: 0,
        academynum:0,
        classsnum:0,
        studentnum:0,
        teachernum:0
      }
    },
    computed: {
      ...mapGetters([
        'name'
      ])
    },
    mounted(){
      this.$http.get('/api/users/add').then(res => {
        console.log('this.panels', res)
      })

      this.$http.post('/api/school/find').then(res=> {
        if(res&&res.length>0) {
          this.schoolnum = res.length
          console.log('res;',res.length)
        }
      })

      this.$http.post('/api/academy/find').then(res=> {
        if(res&&res.length>0) {
          this.academynum = res.length
          console.log('res;',res.length)
        }
      })

      this.$http.post('/api/classs/find').then(res=> {
        if(res&&res.length>0) {
          this.classsnum = res.length
          console.log('res;',res.length)
        }
      })
      
      this.$http.post('/api/student/find').then(res=> {
        if(res&&res.length>0) {
          this.studentnum = res.length
          console.log('res;',res.length)
        }
      })

     this.$http.post('/api/teacher/find').then(res=> {
        if(res&&res.length>0) {
          this.teachernum = res.length
          console.log('res;',res.length)
        }
      })


      



    }
  }</script>
<style lang="scss" scoped>
  .dashboard {
    &-container {
      margin: 30px;
    }
    &-text {
      font-size: 30px;
      line-height: 46px;
    }
  }</style>